Houdini 13.0

Expressions are mainly used in parameter fields. These form the backbone of Houdini. You can also type in expressions in to the textport but in order for them to evaluate you have to precede with the command echo and encase the expression in back ticks.

For example:

echo `ch(/obj/geo1/ty)`

will return to the textport the value of /obj/geo1’s TY parameter.

The old expression language is still available in Houdini for compatibility with older files and scripts. For new animations, we recommend you use the new HOM scripting architecture instead.

Functions


Create your own expression functions
Expression language data types
Global expression variables
Expression language operators
Pattern matching
Quoting and embedding expressions
absReturns the absolute value of the argument.
acosReturns the arc-cosine of the argument.
angvelReturns the angular velocity required to rotate an object from one orientation to another in a certain period of time.
arclenReturns the arc length of a curve between two U positions.
argReturns an argument from a list of HScript-style arguments.
argcReturns the number of arguments in an HScript-style list of arguments.
asinReturns the arc-sine of the argument.
atanReturns the arc-tangent of the argument.
atan2Returns the arc-tangent of y/x.
atofConverts a string to a float.
bboxReturns bounding box information for a surface node.
bezierChannel segment function: Bezier interpoloation spline
boneangleReturns the angle at the joint between two bone objects.
ceilReturns the smallest integer not less than the value passed in.
centroidReturns centroid information for a surface node.
chReturns the value of a parameter.
chexistReturns 1 if the specified channel exists, 0 if it doesn't.
chfEvaluates a parameter at a given frame.
chgroupreturn a string containing all of the channels contained in a group.
chopEvaluates a channel within a CHOP at the current time.
chopcfEvaluates a channel within a CHOP at a given time.
chopciEvaluates a channel within a CHOP at a specified sample point.
chopctEvaluates a channel within a CHOP at a specified time.
chopeReturns the end index of the channels in a CHOP.
chopfEvaluates a channel within a CHOP with at a given frame.
chopiEvaluates a channel within a CHOP at a given sample point.
choplReturns the length of the channels in a CHOP, in samples.
chopnReturns the number of data channels within a CHOP.
choprReturns the sample rate of a CHOP.
chopsReturns the start index of a CHOP.
chopstrReturns the string value of a channel within a CHOP at the current time.
choptReturns the value of a channel within a CHOP at a specified time.
chrampReturns the value of a ramp parameter at a specific position.
chrampfReturns the value of a ramp parameter at a specific position and frame.
chramptReturns the value of a ramp parameter at a specific position and time.
chsEvaluates the string value of a parameter at the current time.
chsopEvaluates the parameter at the current time as a node path string.
chsrawReturns the raw expression value of a parameter as a string.
chtReturns the value of a parameter at a specified time.
clampReturns a value clamped between a minimum and maximum.
clamptosphereClamps a vector to always end between a minimum and maximum sphere.
constantChannel segment function: constant value.
cosReturns the cosine of the argument.
coshReturns the hyperbolic cosine of the argument.
crossComputes the cross-product of two vectors.
cubicChannel segment function: cubic spline.
cucwcDeprecated: current working container for custom panels.
cudatatypeDeprecated: data type of a gadget, for custom panels.
cumenuaddDeprecated: adds a menu entry on a custom panel.
cuqueryDeprecated: returns a value from a custom panel.
curvatureReturns the curvature of the surface at the given UV coordinates.
cutypeDeprecated: Returns the type of a gadget on a custom panel.
cycleChannel segment function: repeats animation from previous frames.
cycleoffsetChannel segment function: repeats the animation between frames f1 and f2, accumulating the value.
cycleoffsettChannel segment function: repeats the animation between times t1 and t2, accumulating the value.
cycletChannel segment function: repeats animation from previous frames.
degConverts from radians to degrees.
degreeReturns the degree a specified face or hull.
detailReturns the value of a detail attribute.
detailattribsizeReturns the number of components in a detail attribute.
detailattribtypeReturns the type of a detail attribute.
detailsReturns the string value of a detail attribute.
detailsmapReturns a string from a list of strings in a detail attribute.
detailsnummapReturns the number of unique stings bound to a detail attribute.
determinantReturns the determinant of a matrix.
dihedralComputes the dihedral matrix between vectors v0 and v1.
distanceReturns the distance between two 3D points.
dopallfieldsReturns a space separated list of all the field names that can be passed to the dopfield function.
dopcontextgeoReturns the full path of the node connected to a dopnetwork.
dopcountslicesReturns the number of records of a given type in a piece of dynamics data.
dopfieldReturns the value of a field as a float.
dopfieldnameReturns the name of a DOP field.
dopfieldsReturns the value of a DOP field as a string.
dopfieldtypeReturns the type of a DOP field.
dopframeReturns the current frame of the simulation.
dopframetostReturns the simulation time equivalent of a simulation frame.
dopgrouphasobjectReturns 1 if a specified DOP group contains a specified object.
dopgroupismutualReturns 1 if a specified DOP group is mutually affecting.
dopgrouplistreturns a string containing a list of all object groups for the current time in a specified DOP Network.
dophasfieldReturns 1 if a specified DOP field exists.
dophassubdataReturns 1 if a dynamics object has the specified subdata.
dopnodeobjsReturns the list of objects processed by a DOP in the latest timestep.
dopnumfieldsReturns the number of fields in a DOP record type.
dopnumobjectsreturns the number of objects in a simulation.
dopnumrecordsReturns the number of records of a given type in a piece of dynamics data.
dopnumrecordtypesReturns the number of types of record in a piece of dynamics data.
dopnumsubdataReturns the number of subdata items attached to an object or data.
dopobjectlistReturns all objects matching the an object specification.
dopobjectsareaffectorsTests whether a set of objects has an affector relationship with another object.
dopobjscreatedbyReturns the list of objects created by a particular DOP node.
dopoptionReturns the value of a DOP field as a float.
dopoptionsReturns the value of a DOP field as a string.
doprecordtypenameReturns the name of a record in DOPs data given its index.
dopsolvedopnetScript solver support function.
dopsolvenewobjectScript solver support function.
dopsolvenumnewobjectsScript solver support function.
dopsolvenumobjectsScript solver support function.
dopsolveobjectScript solver support function.
dopsolvetimestepScript solver support function.
dopsttoframereturns the simulation frame of a given simulation time.
dopsttotReturns the global time of a given simulation time.
dopsubdatanameReturns the name of a subdata of a given DOP object.
doptimeReturns the current time of a simulation.
doptransformReturns a transformation matrix associated with a piece of data.
dopttostReturns the simulation time equivalent to a given global time.
dopvelatposReturns the velocity that a point at a location in simulation space would have if it were attached to a DOP object.
dotComputes the dot product of two vectors.
easeChannel segment function: ease-in and -out.
easeinChannel segment function: ease-in.
easeinpChannel segment function: ease-in with configurable acceleration.
easeoutChannel segment function: ease-out
easeoutpChannel segment function: ease-out with configurable acceleration.
easepChannel segment function: ease-in and -out with configurable acceleration.
edgegrouplistReturns the list of edge groups in a surface node.
edgegroupmaskReturns the list of edge groups matching a pattern in a surface node.
evalEvaulates a string as an expression returning a float.
evalsEvaulates a string as an expression returning a string.
executeRuns a string as an HScript command and returns the command’s output.
executebRuns a string as an HScript command and returns the command and error output.
executeeRuns a string as an HScript command and returns any error output.
expReturns the logarithmic exponentiation of the argument.
explodematrixExplodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.
explodematrixpExplodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.
findfileSearches the Houdini path for a file.
findfilesSearches the Houdini path for a file or directory.
fitFits a value from one range to another.
fit01Fits a value to the 0-1 range.
fit10Fits a number in the 0-1 range.
fit11Fits a number to the -1 to 1 range.
floorReturns the largest integer not greater than a number.
fracReturns the fractional part of a floating-point number.
ftoaConverts a number to a string.
groupbyvalReturns a string describing the set of elements with a given value for an integer attribute.
groupbyvalsReturns a string describing the set of elements with a given value for a string attribute.
hasdetailattribReturns 1 if a specified detail attribute exists.
haspoint
haspointattribReturns 1 if a specified point attribute exists.
hasprimReturns 1 if a specified primitive is in a specified group.
hasprimattribReturns 1 if a specified primitive attribute exists.
hasvertexattribReturns 1 if a specified vertex attribute exists.
hextointConverts a hexadecimal argument string into an integer.
hsvConverts RGB values to HSV components.
icEvaluates a CHOP’s input channel at a specific index.
iceReturns the end index of a CHOP’s input.
iclReturns the length of a CHOP’s input, in samples.
icmaxEvaluates a CHOP’s input channel’s maximum value.
icminEvaluates a CHOP’s input channel’s minimum value.
icnReturns the number of channels in a CHOP’s input.
icrReturns the sample rate of a CHOP’s input.
icsReturns the start index of a CHOP’s input.
identityCreates an identity matrix.
ifReturns the value of the second or third argument depending on the truth of the first argument.
ifsReturns the string value of the second or third argument depending on the truth of the first argument.
indexFinds the first occurrence of a pattern in a string.
instancepointReturns the point number currently being instanced onto.
intConverts a number to an integer by truncating any fractional part.
inttohexConverts a number into a hexadecimal string.
invertInverts a matrix.
iprqueryQueries numeric (floating point) data from an interactive render pane.
iprquerysQueries textual (string) data from an interactive render pane.
isclosedReturns 1 if a primitive is closed.
iscollidedReturns 1 if a specified point has collided with something.
ishvariableReturns 1 if a specified Houdini environment variable exists.
issplineReturns 1 if a specified primitive is a NURBs or Bezier curve or surface.
isstuckReturns 1 if a specified point is a stuck particle.
isvariableReturns 1 if a specified Houdini or system environment variable exists.
iswrapuReturns 1 if a specified primitive is wrapped in U.
iswrapvReturns 1 if a specified primitive is wrapped in V.
lengthReturns the length of a vector.
linearChannel segment function: linear interpolation.
listbyvalReturns a list of elements with a given value for an integer attribute.
listbyvalsReturns a list of elements with a given value for a string attribute.
lockReturns a value that cannot be changed.
logReturns the natural logarithm of the argument.
log10Returns the base 10 logarithm of the argument.
matchChannel segment function: matches the incoming and outgoing slopes.
matchinChannel segment function: matches the incoming slope.
matchoutChannel segment function: matches the outgoing slope.
matrixConverts a string specification into a matrix.
matrixtoquatConverts a rotation matrix to a quaternion.
maxReturns the larger of two values.
mcolsReturns the number of columns in a matrix.
metaweightReturns the weight of a metaball at a specific location.
minReturns the smaller of two values.
mindistFinds the smallest distance between a point and a primitive.
mlookatComputes the transformation matrix of a lookat from one vector to another.
mlookatupComputes the transformation matrix of a lookat from one vector to another, with an up vector.
mobjlookatComputes the transformation matrix of a lookat from one object to another.
modblendBlends the two modular values.
morientComputes the transformation matrix to orient along specific Z and Y axes.
mousepaneReturns the full name of the pane currently under the mouse pointer.
mousepathReturns the node path of the pane currently under the mouse pointer.
mrowsReturns the number of rows in a matrix.
mzeroReturns a matrix with all values set to 0.
nearpointFinds the point in a geometry nearest to specific 3D coordinates.
noiseGenerates 3D noise.
normalReturns the components of the surface normal specific UV coordinates.
normalizeNormalizes a vector.
npointsReturns the number of points in a geometry.
npointsgroupReturns the number of points in the specified group.
nprimsReturns the number of primitives in a surface node.
nprimsgroupReturns the number of primitives in the specified group.
nuniquevalsReturns the number of unique values for an integer or string attribute in a surface node.
objkinoverrideReturns the current global kinematic override setting for bone objects.
objlightmaskReturns a list of lights matching an object’s light mask.
objlookatComputes the rotation vector of a lookat from one object to another.
objpretransformReturns an object’s pre-transform matrix.
ocReturns the value of a CHOP’s output at a specific sample index.
oldrandReturns a pseudo-random number between 0 and 1.
opblistReturns the full paths of all operators in a bundle.
opcreatorReturns the creator of this node.
opdigitsReturns the numeric suffix of a node name.
opexistReturns 1 if the specified node, group, or bundle exists.
opflagReturns a list nodes with a particular flag set.
opfullpathReturns the full path of a node.
opfullpathfromReturns the path of a node relative to another node.
opidReturns the unique ID of a node.
opinputReturns the name of the node connected to a given input.
opinputpathReturns the full path of the node connected to a given input.
opisloadingReturns 1 if Houdini is currently loading a scene file.
opisquittingReturns 1 if Houdini is currently shutting down.
oplightmaskReturns a list of lights matching an object’s light mask.
opnameReturns the name of a node given its path.
opnchildrenReturns the number of nodes inside a container node.
opninputsReturns the maximum number of connected inputs.
opnoutputsReturns the number of nodes connected to a node’s output.
opoutputReturns the name of a node connected a given node’s output.
opoutputpathReturns the full path of a node connected a given node’s output.
oppinputDeprecated: replaced by opinput.
oppwdReturns the path of the current network.
oppwfPrints the path of the current network.
oprelativepathReturns the relative path from one node to another.
opselectReturns a list of the selected nodes.
opselectrecurseReturns a recursive list of the selected nodes.
opsubpathReturns the full path of a node including any containing subnets.
optransformReturns the transformation matrix of an object at the current time.
optypeReturns the type of a node.
optypeinfoReturns type information about a node.
originReturns components of an object’s transforms.
originoffsetReturns components of an object’s offset transforms.
padzeroReturns a string padding a number to a given length with zeros.
paramDeprecated: use stamp instead.
parmisstringReturns 1 if a specified parameter is a string.
picReturns the color of a pixel in a compositing node.
picniReturns the non-interpolated color of a pixel in a compositing node.
pluralizeConverts an English noun to its plural.
pointReturns the value of a point attribute.
pointattribsizeReturns the number of components in a point attribute.
pointattribtypeReturns the type of a point attribute.
pointavgReturns the average of an attribute across all points in a geometry.
pointdistReturns the distance between a point and a primitive.
pointgrouplistReturns the list of point groups in a surface node.
pointgroupmaskReturns the list of point groups matching a pattern in a surface node.
pointlistReturns a list of all points in a point group.
pointneighboursLists points that share a minimum number of primitives with a specified point.
pointpatternReturns a list of points that match a specified pattern.
pointsReturns the string value of a point attribute.
pointsmapReturns a string from a list of strings in a point attribute.
pointsnummapReturns the number of unique strings bound to a point attribute.
popcontextgeoReturns the full path to a particle network context geometry.
popeventReturns 1 if a particle event is occurring.
popeventtimeReturns the time of a particle event.
poppointReturns the value of a particle attribute, by particle number.
poppointidReturns the value of a particle attribute, by particle ID.
poppointnumReturns the point number of the particle with the specified ID.
poppointsReturns the string value of a particle attribute, by particle number.
poppointsidReturns the string value of a particle attribute, by particle ID.
powRaises a number to an exponent.
primReturns the value of a primitive attribute.
primattribsizeReturns the number of components in a primitive attribute.
primattribtypeReturns the type of a primitive attribute.
primdistReturns the minimum distance and closest points between two primitives.
primduvReturns the partial derivatives of a primitive attribute.
primgrouplistReturns the list of primitive groups in a surface node.
primgroupmaskReturns the list of groups matching a pattern in a surface node.
primlistReturns a list of all primitives in a surface node.
primneighboursLists primitives that share a minimum number of points with a specified primitive.
primsReturns the string value of a primitive attribute.
primsmapReturns a string from a list of strings in a primitive attribute.
primsnummapReturns the number of unique strings bound to a primitive attribute.
primuvReturns the value of a primitive attribute at a certain UV location.
printPrints a message to the console.
pulseReturns 1 when a value is within a certain range.
pythonexprfEvaluates a Python expression, returning a float result.
pythonexprsEvaluates a Python expression, returning a string result.
qlinearChannel segment function: uses quaternions to interpolate.
quattomatrixConverts quaternion to a 3×3 rotation matrix.
quinticChannel segment function: smoothly interpolates slopes and accelerations.
radConverts from degrees to radians.
randReturns a pseudo-random number from 0 to 1.
rawChannel segment function.
realuvConverts unit UV to real UV.
repeatChannel segment function: repeats animation from previous frames.
repeattChannel segment function: repeats animation from previous frames.
resReturns the natural resolution of the image in a compositing node.
rgbConverts HSV values to RGB components.
rindexFinds the last occurrence of a pattern in a string.
rintRounds to the nearest integer.
rotateReturns a 4×4 rotation matrix from an axis and angle.
rotaxisReturns a 4×4 rotation matrix from an angle and a vector.
roundRounds a number to the nearest integer.
runRuns a string as an HScript command and returns the command’s output.
runbRuns a string as an HScript command and returns the command and error output.
runeRuns a string as an HScript command and returns any error output.
scaleTakes three scaling values and returns a scale matrix.
seampointsLists all seam points in a surface node.
seqanimReturns 1 if a specified compositing node has an animated sequence.
seqendReturns the end frame of a compositing node’s image sequence.
seqlengthReturns the number of frames in a compositing node’s image sequence.
seqstartReturns the start frame of a compositing node’s image sequence.
shopstringReturns the shader string generated by a shader.
signReturns -1, 0, or 1 depending on the sign of the argument.
sinReturns the sine of the argument.
sinhReturns the hyperbolic sine of the argument.
smoothTakes a value and range and returns a smooth interpolation between 0 and 1.
snoiseGenerates sparse convolution 3D noise.
spknotReturns a knot value on a spline curve or surface.
splineChannel segment function: fits a curve to the keyframes.
sqrtReturns the square root of the argument.
stampReturns a copy stamping floating point value.
stampsReturns a copy stamping string value.
strcasecmpCompares two strings, ignoring case.
strcasematchReturns 1 if a string matches a pattern, ignoring case.
strcatReturns the concatenation of two strings.
strcmpCompares two strings.
strdupDuplicates a string.
stripmatrixStrips non-essential characters from the string representation of a matrix or vector.
strlenReturns the number of characters in a string.
strmatchReturns 1 if a string matches a pattern, including case.
strreplaceReplaces substrings with a new string.
sturbGenerates spatially coherent 3D noise based on sparse convolution.
substrReturns a substring of a string.
surflenReturns the length of the 3D curve between two points on a surface.
systemRuns a system command line and returns the output.
systemESRuns a system command line and returns the exit status.
systemRAWRuns a system command line and returns the output with no processing.
tanReturns the tangent of the argument.
tanhReturns the hyperbolic tangent of the argument.
texReturns the interpolated color of a point on an on-disk texture map.
texniReturns the non-interpolated color of a point on an on-disk texture map.
tolowerReturns the all-lowercase version of a string.
toupperReturns the all-uppercase version of a string.
translateTakes X, Y, and Z translation values and returns a translation matrix.
transposeTransposes a matrix.
truncConverts a number to an integer by truncating any fractional part, rounding towards 0.
turbGenerates spatially coherent 3D noise.
uniquevalReturns a unique value of an integer attribute.
uniquevalsReturns a unique value of a string attribute.
unituvConverts real UV to unit UV.
uvdistReturns the distance between parameteric locations on two primitives.
vangleReturns the angle between two vectors.
vectorConverts a string specification into a vector.
vector3Converts three values into a 3-component vector.
vector4Converts four values into a 4-component vector.
vertexReturns the value of a vertex attribute.
vertexattribsizeReturns the number of components in a vertex attribute.
vertexattribtypeReturns the type of a vertex attribute.
vertexsReturns the string value of a vertex attribute.
vertexsmapReturns a string from a list of strings in a vertex attribute.
vertexsnummapReturns the number of unique strings bound to a point attribute.
vlengthReturns the length of a vector.
vlength2
vmatchChannel segment function: matches the incoming and outgoing slopes.
vmatchinChannel segment function: matches the incoming slope.
vmatchoutChannel segment function: matches the outgoing slope.
volumeaverageReturns the average value of all the voxels in a volume.
volumegradientReturns the gradient of a volume primitive at a specified location.
volumeindexReturns the value of a volume primitive at a specified voxel.
volumeindextoposConverts volume voxel coordinates to world-space coordinates.
volumemaxReturns the maximum value of all voxels in a volume.
volumeminReturns the minimum value of all voxels in a volume.
volumepostoindexConverts world space coordinates to volume voxel coordinates.
volumeresReturns the resolution of a volume.
volumesampleReturns the value of a volume at a specified position.
volumevoxeldiameterReturns the approximage diameter of a volume voxel in world space.
voriginReturns a vector of an objects' transforms.
vpnameTakes a viewer name and a viewport number and returns the viewport’s name.
vroriginReturns a vector of an object’s rotations.
vscaleMultiplies a vector by a scaling factor.
vsetCreates a vector with each component set to the same value.
vsizeReturns the number of elements in a vector.
vtoriginReturns a vector of an object’s translations.
wrapWraps a value between a minimum and maximum.
xyzdistReturns the distance between a 3D coordinate and a primitive.